package com.xr.redis.pubsub.enums;

/**
 * @author Arnold Yand
 * @summary redis 发布/订阅 实现方式
 * @time 2018/8/7 16:35
 */
public enum RedisPubSubImplementType {

  PUB_SUB("redis pubsub"),
  LIST("redis list")
  ;
  private String type;

  private RedisPubSubImplementType(String type){
    this.type = type;
  }

  public String getType() {
    return type;
  }

  public void setType(String type) {
    this.type = type;
  }

  public static RedisPubSubImplementType parse(String type){
    for(RedisPubSubImplementType rpsit : RedisPubSubImplementType.values()){
      if(rpsit.name().equals(type)){
        return rpsit;
      }
    }

    // 默认
    return RedisPubSubImplementType.PUB_SUB;
  }
}
